<?php
namespace App\Adshopuser\Models;
use Common\BaseModel;

class BShopSkuModelKey extends BaseModel
{
    public $res;
    public $expire;

    public function initialize()
    {
        parent::initialize();
        $this->setSource('b_shop_sku_model_key');
    }


    public function getDetails($mid){
        $conditions = "m_id = $mid";
        $list = $this->find(array(
            $conditions,
        ))->toArray();
        $result = array();
        if(!empty($list)){
            $valDb = new BShopSkuValue();
            $ids = implode(',',array_column($list,'k_id'));
            $result = $valDb->keyValueList($ids);
        }
        return $result;
    }
}
